package com.kangfu.api.controller;

import com.kangfu.common.annotation.IgnoreAuth;
import com.kangfu.common.constant.WechatConstant;
import com.kangfu.common.utils.RedisUtils;

import com.kangfu.wechat.api.UrlschemeApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


@Controller
@RequestMapping("")
public class CommonController {

    @Autowired
    public RedisUtils redisUtils;



    @GetMapping("/1")
    @IgnoreAuth
    public void miniprogram(HttpServletResponse response) throws IOException {
        String url = UrlschemeApi.getUrlscheme(WechatConstant.APPID, WechatConstant.SECRET);
        response.sendRedirect(url);
    }



}
